package com.fynu.demo5;

public class Text {
    public static void main(String[] args) {

        new Animal(){
            @Override
            public void eat() {
                System.out.println("吃");
            }
        };


        new Swim(){
            public void swim(){
                System.out.println("游泳");
            }
        }.swim();
        Dog d = new Dog();
        d.eat();
        new Dog(){
            @Override
            public void eat() {
                System.out.println("狗吃肉");
            }
        }.eat();



    }
}
